﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<SampleWebsite.Areas.UserAdministration.Models.UserAdministration.IndexViewModel>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	UserRoles
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<link href='<% =Url.Content("~/Content/MvcMembership.css") %>' rel="stylesheet" type="text/css" />

    <h2>User Roles</h2>

    <div class="mvcMembership-allRoles">
        <div class="form_settings">
        <% using(Html.BeginForm("CreateRole", "UserAdministration")){ %>
		    <fieldset>
			    <label for="id">Role:</label>
			    <% =Html.TextBox("id") %>
			    <input type="submit" value="Create Role" />
		    </fieldset>
	    <% } %>

	    <% if(Model.Roles.Count() > 0 ){ %>
		    <ul>
			    <% foreach(var role in Model.Roles){ %>
			    <li>
				    <span><% =Html.ActionLink(role, "Role", new{id = role}) %></span>
				    <% using(Html.BeginForm("DeleteRole", "UserAdministration", new{id=role})){ %>
				    <input type="submit" value="Delete" />
				    <% } %>
			    </li>
			    <% } %>
		    </ul>
	    <% }else{ %>
		    <p>No roles have been created.</p>
	    <% } %>
	    </div>
    </div>
</asp:Content>
